<template>
	<view>
		<!-- 导航栏部分 -->
		<view class="status-contents">
			<view class="status-contents_left"  @click="back()">
				<uni-icon type="back" size="30" class="back"  color="#fff"></uni-icon>
			</view>
			<view class="status-contents_centent">
				我的钱包
			</view>
		</view>
		
		<view class="myWallet">
			<view class="quotaBox">
				<text class="money" v-if="!money">0</text>
				<text class="money" v-else="">{{money/100}}</text>
				<text class="allMoney">预付款总额</text>
				
			</view>
			<button  class="btnOne" @click="goAccountPay">充值</button>
			<button  class="btnTwo" @click="goBill">充值记录</button>
			
		</view>
	</view>
</template>

<script>
	import uniIcon from "@/components/uni-icon/uni-icon.vue"
	import eonfox from '@/components/eonfox/eonfox.js';
	import fns from '@/components/eonfox/fns.js';
	var ef=new eonfox()
	export default {
		data() {
			return {
				money:0,
				pay_state:false,
				pay_money:'',
				pay_switch:false,
				choiceone:true,
				choicetwo:false
			};
		},
		onShow() {
			this.load()
		},
		methods:{
			back() {
				uni.navigateBack({
					delta: 1
				});
			},
			goBill(){
				uni.navigateTo({
					url: '../../pagesA/transactionDetail/transactionDetail?method=user_money'
				})
			},
			goAccountPay(){
				
				uni.navigateTo({
					url: '../../pagesB/accountPay/accountPay'
				})
			},
			
			
			//支付结果查询（订单号）
			pay_result_query(order_id,fun){
				console.log('正在查询');
				ef.submit({
					request: {
						s: ['APPLICATIONORDERSELFPAYSTATE', [{
							order_id: order_id
						}]]
					},
					callback: function(data) {
						// console.log('支付查询回调成功',data.data.s.data) ;return data.data.s.data;
						if(fns.checkError(data,'s',function(errno,error){
							return false;
						})){
							fun()
						}
					},
					error: function(err) {
						return 0;
					}
				})
			},
			load(){
				var that=this;
				ef.submit({
					request: {
						s: ['USERMONEYSELFTOTAL']
					},
					callback: function(data){
						console.log("预付款",data);
						if(data.data.s.errno==0){
							that.money=data.data.s.data;
						}
						
					},
					 error: function(err){
							 console.log("出错啦", err);
					},
				});
			}
			
		},
		components:{
			uniIcon
		}
	}
</script>

<style>
	page{
		background-color: #ebebeb29;
	}
	.status-contents{
		width: 100%;
		height: 100upx;
		background: rgba( 242 155 135);
		display: flex;
		line-height: 100upx;
	}
	.status-contents_left{
		position: absolute;
		top:-5upx
	}
	.status-contents_centent{
		width: 100%;
		text-align: center;
		color: #FFFFFF;
	}
	
	.btnOne{
		 width: 540upx;
		 height: 80upx;
		 background: rgba( 242 155 135);
		 font-size: 30upx;
		  line-height: 80upx;
		  color: #FFFFFF;
	}
	.btnTwo{
		 width: 540upx;
		 height: 80upx;
		 background-color: #ebebeb29;
		 border: #F29B87 solid 1upx;
		 color: #F29B87;
		 font-size: 30upx;
		 line-height: 80upx;
		 margin-top: 50upx;
	}
</style>
<style scoped lang="stylus" ref="stylesheet/stylus">
	
	
	.myWallet
		.myWalletTitle
			text-align center
			height 50px
			position relative
			.backBtn
				position absolute
				top 0
				left 3px
				height 50px
				width 50px
				display inline-block
				display flex
				justify-content center  
				align-items center       
				flex-direction row
			.myWalletTitleText
				line-height 50px
		.quotaBox
			width 100%
			height 167px
			display flex
			justify-content center  
			align-items center       
			flex-direction column
			font-weight 600
			position relative
			.money
				font-size 36px
				color #F29B87
			.allMoney
				margin-top 10px
				margin-bottom 50px
				color #CCCCCC
				font-size 30upx
			
</style>
